<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录页</title>
</head>
<body>
	<form >
		<label>用户名：<input type="text" name="username" id="username" value="test1"></label><br>
		<label>密&nbsp;&nbsp;&nbsp;&nbsp;码：<input type="password" name="password" id="password" value="123456"></label>
			<br>
		<input type="button" value="提交" id="submit">&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="reset" value="清除">
	</form>
<script type="text/javascript" src="/hotel/js/jquery.min.js"></script>

<script  type="text/javascript">
$("#submit").click(function(){
		//alert("test")
		$.post("/hotel/system/login.do",
				{"username":$("#username").val(),"password":$("#password").val()},
				function(str){
					//alert(str)
					var res=eval('(' +str + ')')
					//alert(res.message);
					if(res.code==0){
						window.location.href="/hotel/system/mainPage"
					}else{
						alert(res.message);
					}
				});
	});
</script>
</body>
</html>